//
//  ViewController.m
//  xingzuo
//
//  Created by liuchengming on 17/10/26.
//  Copyright © 2017年 zhouxiong. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()<UIWebViewDelegate>
@property (weak, nonatomic) IBOutlet UIActivityIndicatorView *av;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    NSURL *url =[NSURL URLWithString:@"http://m.xzw.com/fortune/aries/"];
    NSURLRequest *request =[NSURLRequest requestWithURL:url];
    [self.wbview loadRequest:request];
    _wbview.delegate = self;
    _wbview.dataDetectorTypes = UIDataDetectorTypeLink;
    _wbview.scalesPageToFit =YES;
    //_wbview.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
    //[self.view addSubview:_wbview];
    //_wbview.delegate = self;
    [_av startAnimating];
    
    
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    [_av stopAnimating];
}

- (IBAction)backMainView:(id)sender
{
    NSURL *url =[NSURL URLWithString:@"http://m.xzw.com/fortune/aries/"];
    NSURLRequest *request =[NSURLRequest requestWithURL:url];
    [self.wbview loadRequest:request];
    _wbview.delegate = self;
    _wbview.dataDetectorTypes = UIDataDetectorTypeLink;
    _wbview.scalesPageToFit =YES;
    [_av startAnimating];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
